package com.sunrise.generico.entidade;

import java.util.Collection;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;

import org.hibernate.validator.constraints.NotEmpty;

import com.sunrise.generico.entidade.iface.EntidadeManter;

@Entity
@Table(name = "notificacao")
public class Notificacao implements EntidadeManter {

	/**
	 * 
	 */
	private static final long serialVersionUID = 11231209234850234L;

	@Id
	@SequenceGenerator(name = "pk_sequence", sequenceName = "notificacao_id_seq", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "pk_sequence")
	@javax.persistence.Column
	@Getter
	@Setter
	private Long id;

	@NotEmpty(message = "{descricaoObrigatorio}")
	@Column(name = "nome")
	@Getter
	@Setter
	private String nome;

	@NotEmpty(message = "{descricaoObrigatorio}")
	@Column(name = "descricao", length= 3000)
	@Getter
	@Setter
	private String descricao;
	
	@Column(name = "dataNotificacao")
	@Getter
	@Setter
	private Date dataNotificacao;
	
	@OneToOne
	@Getter
	@Setter
	private Usuario criador;

	@OneToMany
	@Getter
	@Setter
	private Collection<StatusNotificacao> statusNotificacao;

	@OneToMany
	@Getter
	@Setter
	private Collection<Perfil> perfis;

	@Column(name = "leituraObrigatoria")
	@Getter
	@Setter
	private Boolean leituraObrigatoria;
	
	@Column(name = "ativo")
	@Getter @Setter
	private Boolean ativo;
	
}
